package com.test.objects;

import java.util.Arrays;
import java.util.Date;
import java.util.SortedSet;
import java.util.TreeSet;

import com.test.objects.MyPageComparator.compare_type;

public class Comment {
	private int id;
	private int parentId;
	private SortedSet<Comment> subComments = 
		new TreeSet<Comment>(
			new MyPageComparator(compare_type.increase));
	private Author author;
	private String content;
	private String url;
	private String contentEx;
	private Date dateTime;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	public int getParentId() {
		return parentId;
	}
	public void setParentId(int parentId) {
		this.parentId = parentId;
	}
	
	public Comment[] getSubComments() {
		return this.subComments.toArray(new Comment[] {});
	}
	public void addSub(Comment cmt){
		this.subComments.add(cmt);
	}
	public void addSubs(Comment[] list) {
		this.subComments.addAll(Arrays.asList(list));
	}

	public Author getAuthor() {
		return author;
	}
	public void setAuthor(Author author) {
		this.author = author;
	}

	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}

	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}

	public String getContentEx() {
		return contentEx;
	}
	public void setContentEx(String contentEx) {
		this.contentEx = contentEx;
	}
	
	public Date getDateTime() {
		return dateTime;
	}
	public void setDateTime(Date dateTime) {
		this.dateTime = dateTime;
	}
}
